package com.mushuilingfeng.ddd.framework.factory;

import com.mushuilingfeng.ddd.framework.ComponentFactoryHolder;
import com.mushuilingfeng.ddd.framework.event.IDomainEventPublisher;
import com.mushuilingfeng.ddd.framework.event.IDomainEventSubscribe;

/**
 * 事件工厂
 *
 * @author mushuilingfeng
 * @date 2024/9/14
 */
public class DomainEventFactory {
    private DomainEventFactory() {

    }

    public static IDomainEventPublisher getEventPublisher() {
        return ComponentFactoryHolder.getComponentFactory().getComponent(IDomainEventPublisher.class);
    }

    public static IDomainEventSubscribe getEventSubscribe() {
        return ComponentFactoryHolder.getComponentFactory().getComponent(IDomainEventSubscribe.class);
    }

}
